package com.osgix.demo.mvc.controller;

import java.util.Collections;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.osgix.common.mvc.AbsMultiActionController;
import com.osgix.pojo.Account;

@Controller
public class jsonController extends AbsMultiActionController {
	private static final Logger logger = Logger.getLogger(jsonController.class);

	@RequestMapping(value = "/account", method = RequestMethod.GET)
	public @ResponseBody
	Map<String, ? extends Object> account(@RequestBody Account account, HttpServletResponse response) {
		response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
		System.out.println("eeee");
		return Collections.singletonMap("account", account);
	}

	public void afterPropertiesSet() throws Exception {
		// TODO Auto-generated method stub
	}

	@Override
	protected ModelAndView handleRequestInternal(HttpServletRequest arg0, HttpServletResponse arg1) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}
}
